<?php


namespace app\api\controller;


use app\common\controller\Api;

class Test extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    public function test()
    {
//        return 113123;
        $data = $this->request->post();
        $url = 'https://api.mch.weixin.qq.com/v3/pay/transactions/jsapi';
        $res = curl_post($url, $data);
        return json($res);
//        [
//            'appid'=> 'wxbe01d607d47d091e',
//            'mchid'=> '1579976061',
//            'description'=> 'VVV',
//            'out_trade_no'=> '2342341234234',
//            'notify_url'=> '',
//            'amount'=> [
//                'total'=> 1000
//            ],
//            'payer'=> [
//                'openid'=> 'ocUIa49sKCG0vIUFeRNnwEVSr5B4'
//            ]
//        ]
//        return json($res);
    }
}